package bean;

import java.io.File;
import java.io.FilenameFilter;

public class imageBean {
        class FileNames implements FilenameFilter{
            public boolean accept(File dir,String name){
                boolean boo=false;
                if(name.endsWith(".jpg")||name.endsWith(".JPG"));
                boo=true;
                return boo;
            }
        }
       private int imageNumber=0;
        private String pictrueName[],playImage;
        public imageBean(){
            File file=new File("D:\\dev\\sctu-javaweb-2018-1\\" +
                    "1606101007邱义成lab03\\web\\image");
            pictrueName=file.list(new FileNames());
        }
        public String getPlayImage(){
            playImage=new String("<image src=image/"
                    +pictrueName[imageNumber]+"" +"></image>");
            return playImage;
        }
}

